package com.hotel.main.entity;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: aprokopchuk
 * Date: 17.05.11
 */
public abstract class AbstractEntity implements Serializable {

    public abstract void setId(Long id);

    public abstract Long getId();

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AbstractEntity that = (AbstractEntity) o;

        if (!getId().equals(that.getId())) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return getId().hashCode();
    }
}
